package a.h;

import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.Hashtable;

class zd
  extends JPanel
{
  JSlider a;
  JTextField b;
  double c;
  double d;
  double e;
  double f;
  double g;
  boolean h;
  boolean i;
  boolean j;
  boolean k = true;
  boolean l;
  
  public zd(int paramInt1, int paramInt2, int paramInt3)
  {
    a(paramInt1, paramInt2, paramInt3, 0, true);
  }
  
  public zd(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5)
  {
    a(paramInt1, paramInt2, paramInt3, 0, true);
    this.a.setPreferredSize(new Dimension(paramInt4, this.a.getPreferredSize().height));
    this.b.setPreferredSize(new Dimension(paramInt5, this.b.getPreferredSize().height));
  }
  
  public zd(double paramDouble1, double paramDouble2, double paramDouble3, int paramInt)
  {
    a(paramDouble1, paramDouble2, paramDouble3, paramInt, false);
  }
  
  public zd(double paramDouble1, double paramDouble2, double paramDouble3, int paramInt1, int paramInt2)
  {
    this(paramDouble1, paramDouble2, paramDouble3, paramInt1, paramInt2, 2);
  }
  
  public zd(double paramDouble1, double paramDouble2, double paramDouble3, int paramInt1, int paramInt2, int paramInt3)
  {
    a(paramDouble1, paramDouble2, paramDouble3, paramInt3, false);
    this.a.setPreferredSize(new Dimension(paramInt1, this.a.getPreferredSize().height));
    this.b.setPreferredSize(new Dimension(paramInt2, this.b.getPreferredSize().height));
  }
  
  public void a(boolean paramBoolean)
  {
    this.i = paramBoolean;
  }
  
  public void b(boolean paramBoolean)
  {
    this.h = paramBoolean;
  }
  
  public void d(boolean paramBoolean)
  {
    this.k = paramBoolean;
    a(this.c, this.d, b(this.a.getValue()));
  }
  
  public double a()
  {
    h();
    return b(this.a.getValue());
  }
  
  public int b()
  {
    return (int)a();
  }
  
  public Object d()
  {
    if (this.j) {
      return new Integer(b());
    }
    return new Double(a());
  }
  
  public void a(double paramDouble)
  {
    a(this.c, this.d, paramDouble);
  }
  
  public void a(int paramInt)
  {
    a(paramInt);
  }
  
  public JTextField e()
  {
    return this.b;
  }
  
  public JSlider g()
  {
    return this.a;
  }
  
  private void a(double paramDouble1, double paramDouble2, double paramDouble3, int paramInt, boolean paramBoolean)
  {
    int n = ec.t;
    boolean bool = ec.s;
    this.j = paramBoolean;
    this.g = 1.0D;
    int m = 0;
    do
    {
      while (!bool)
      {
        if (m >= paramInt) {
          break;
        }
        this.g *= 10.0D;
        m++;
      }
    } while (n != 0);
    BoxLayout localBoxLayout = new BoxLayout(this, 0);
    setLayout(localBoxLayout);
    this.a = new JSlider();
    a(paramDouble1, paramDouble2, paramDouble3);
    this.a.addChangeListener(new b_());
    this.b = new JTextField(4);
    Dimension localDimension = new Dimension(500, 28);
    this.b.setMaximumSize(localDimension);
    localDimension = this.a.getPreferredSize();
    localDimension.width = 100;
    this.a.setPreferredSize(localDimension);
    j();
    this.b.setEditable(true);
    this.b.addActionListener(new a_());
    Box localBox = new Box(1);
    localBox.add(Box.createGlue());
    localBox.add(this.b);
    localBox.add(Box.createGlue());
    add(this.a);
    add(Box.createHorizontalStrut(10));
    add(localBox);
  }
  
  int c(double paramDouble)
  {
    return (int)(paramDouble * this.g - this.g * this.c);
  }
  
  double b(int paramInt)
  {
    return paramInt / this.g + this.c - this.e / this.g;
  }
  
  void a(double paramDouble1, double paramDouble2, double paramDouble3)
  {
    int m = ec.t;
    this.d = paramDouble2;
    this.c = paramDouble1;
    this.f = ((paramDouble2 - paramDouble1) * this.g);
    this.e = 0.0D;
    this.a.setPaintLabels(this.k);
    Hashtable localHashtable = new Hashtable(5);
    if (m == 0)
    {
      if (this.j)
      {
        localHashtable.put(new Integer((int)this.e), new JLabel("" + (int)paramDouble1, 4));
        localHashtable.put(new Integer((int)this.f), new JLabel("" + (int)paramDouble2, 2));
        if (m != 0) {
          return;
        }
        if (!ec.s) {}
      }
      else
      {
        localHashtable.put(new Integer((int)this.e), new JLabel("" + paramDouble1, 4));
      }
    }
    else {
      localHashtable.put(new Integer((int)this.f), new JLabel("" + paramDouble2, 2));
    }
    this.a.setMaximum((int)this.f);
    this.a.setValue(c(paramDouble3));
    this.a.setLabelTable(localHashtable);
  }
  
  void h()
  {
    int m = ec.t;
    boolean bool = ec.s;
    String str = this.b.getText();
    double d1 = b(this.a.getValue());
    try
    {
      if (m == 0)
      {
        if (this.j) {
          d1 = Integer.parseInt(str);
        }
      }
      else
      {
        if (m != 0) {
          break label69;
        }
        if (!bool) {
          break label63;
        }
      }
      d1 = Double.parseDouble(str);
      label63:
      label69:
      if (m == 0) {
        if (d1 < this.c)
        {
          if (m == 0) {
            if (this.i)
            {
              a(d1, this.d, d1);
              if (m == 0) {
                if (!bool) {
                  return;
                }
              }
            }
            else
            {
              j();
            }
          }
          if ((m == 0) && (!bool)) {
            return;
          }
        }
      }
      if ((m != 0) || (d1 > this.d))
      {
        if (m == 0) {
          if (this.h)
          {
            a(this.c, d1, d1);
            if (m == 0) {
              if (!bool) {
                return;
              }
            }
          }
          else
          {
            if (m != 0) {
              break label184;
            }
            j();
          }
        }
        if (!bool) {
          return;
        }
      }
      label184:
      this.a.setValue(c(d1));
    }
    catch (Exception localException)
    {
      j();
    }
  }
  
  void j()
  {
    int m = ec.t;
    double d1 = Math.round(b(this.a.getValue()) * this.g) / this.g;
    if (m == 0) {
      if (this.j)
      {
        this.b.setText("" + (int)d1);
        if (m != 0) {
          return;
        }
        if (!ec.s) {
          break label104;
        }
      }
    }
    this.b.setText("" + d1);
    label104:
    f(false);
  }
  
  public boolean k()
  {
    return this.l;
  }
  
  public void f(boolean paramBoolean)
  {
    int m = ec.t;
    this.l = paramBoolean;
    if (m == 0) {
      if (this.l)
      {
        this.b.setText("");
        if (m != 0) {
          break label56;
        }
        this.b.setBackground(ec.a);
        if (!ec.s) {
          return;
        }
      }
    }
    label56:
    this.b.setBackground(Color.white);
  }
  
  public void setEnabled(boolean paramBoolean)
  {
    int m = ec.t;
    boolean bool = ec.s;
    super.setEnabled(paramBoolean);
    if (m == 0) {
      if (this.a != null)
      {
        this.a.setEnabled(paramBoolean);
        Color localColor = ad.a(paramBoolean ? "Label.foreground" : "Label.disabledForeground");
        if (m != 0) {
          break label139;
        }
        Dictionary localDictionary = this.a.getLabelTable();
        if (localDictionary != null)
        {
          Enumeration localEnumeration = localDictionary.keys();
          do
          {
            do
            {
              Object localObject;
              do
              {
                if (!localEnumeration.hasMoreElements()) {
                  break;
                }
                localObject = localDictionary.get(localEnumeration.nextElement());
              } while (!(localObject instanceof JComponent));
              ((JComponent)localObject).setForeground(localColor);
              if ((m != 0) || ((m == 0) && (bool))) {
                return;
              }
            } while (m != 0);
          } while (!bool);
        }
      }
    }
    label139:
    if ((m != 0) || (this.b != null)) {
      this.b.setEnabled(paramBoolean);
    }
  }
  
  public void setBackground(Color paramColor)
  {
    super.setBackground(paramColor);
    if ((ec.t != 0) || (this.a != null)) {
      this.a.setBackground(paramColor);
    }
  }
  
  class b_
    implements ChangeListener
  {
    b_() {}
    
    public void stateChanged(ChangeEvent paramChangeEvent)
    {
      zd.this.j();
    }
  }
  
  class a_
    implements ActionListener
  {
    a_() {}
    
    public void actionPerformed(ActionEvent paramActionEvent)
    {
      zd.this.h();
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.h.zd

 * JD-Core Version:    0.7.0.1

 */